<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../img/asset-favico.ico">
    <title>预约须知</title>
    <link rel="stylesheet" href="../css/page-health-orderNotice.css" />
    <link rel="stylesheet" href="../plugins/elementui/index.css" />
    <script src="../plugins/jquery/dist/jquery.min.js"></script>
    <script src="../plugins/healthmobile.js"></script>
    <script src="../plugins/vue/vue.js"></script>
    <script src="../plugins/vue/axios-0.18.0.js"></script>
    <script src="../plugins/elementui/index.js"></script>
    <script src="../plugins/qrcode.js"></script>
    <script>
        var id = getUrlParam("id");
    </script>
</head>
<body data-spy="scroll" data-target="#myNavbar" data-offset="150">
<div id="app" class="app">
    <!-- 页面头部 -->
    <div class="top-header">
        <span class="f-left"><i class="icon-back" onclick="history.go(-1)"></i></span>
        <span class="center">传智收银台</span>
        <span class="f-right"><i class="icon-more"></i></span>
    </div>
    <!-- 页面内容 -->
    <div id="qrCode">
        </div>
    </div>
</div>
</body>
<script>
    var vue = new Vue({
        el:'#app',
        data:{
            orderInfo:{}  //   显示 预约成功之后  页面展示的数据
        },

        created(){
            axios.get("/order/findOrderDetailByOrderId2/"+id).then((res)=>{
                if(res.data.flag){
                    this.orderInfo = res.data.data
                    this.$message.success(res.data.message);
                    new QRCode("qrCode",this.orderInfo.url)
                    console().log(this.orderInfo.url)
                }else{
                    this.$message.error(res.data.message);
                }
            })

        }
    });
</script>
<script>
    setInterval(function () {
        // 发送ajax请求
        let url = '/order/queryStatus/'+id;
        //let data = 'action=findState&oid=${oid}';
        $.get(url,function (res) {
            if(res.flag){
                //console.log(res)
                // 支付成功了
                location.href='orderSuccess.html?id='+id;
            }
        })
    },5000);
</script>
</html>
